import http from "../utils/request"

//用户分页数据
const userPage = (data) => {
    return http.request({
        url: '/admin/user/userPage',
        method: 'get',
        data: data
    })
}

// /admin/user/updateUser 修改用户
const updateUser = (data) => {
    return http.request({
        url: '/admin/user/updateUser',
        method: 'post',
        data: data
    })
}

///admin/user/changeForbidden 修改禁用状态
const changeForbidden = (data) => {
    return http.request({
        url: '/admin/user/changeForbidden',
        method: 'post',
        data: data
    })
}

///admin/user/{id}  用户详情
const userInfo = (id) => {
    return http.request({
        url: '/admin/user/'+ id,
        method: 'get',
        data: {}
    })
}

//删除用户 /admin/user/{id}
const userDelete = (id) => {
    return http.request({
        url: '/admin/user/'+id,
        method: 'delete',
        data: {}
    })
}

export {
    userPage,
    updateUser,
    userInfo,
    userDelete,
    changeForbidden
}
